﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Member_Master.Master" AutoEventWireup="true"  ViewStateMode="Enabled" CodeBehind="M_Businessnature.aspx.cs" Inherits="WebApplication.M_Businessnature" %>
<%@ Register TagPrefix="uc1" TagName="usermeg" Src="~/UserControl/M_UserMessageControl.ascx" %>
<%@ Register TagPrefix="uc1" TagName="maintab" Src="~/UserControl/M_MainTabControl.ascx" %>
<%--<%@ Register TagPrefix="uc1" TagName="usermeg" Src="~/UserControl/UserMessageControl.ascx" %>
<%@ Register TagPrefix="uc1" TagName="maintab" Src="~/UserControl/MainTabControl.ascx" %>
--%>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link href="Media/Css/master2.css" rel="stylesheet" media="all"/>
<link href="Media/Css/PeterCss.css" rel="Stylesheet" media="all" />
<script type="text/javascript">
    function GetInfo() {
        GetChangeVal();
        if ($("#ContentPlaceHolder2_lkBtnSave").hasClass("aspNetDisabled").toString() != "true") {
            $("#ContentPlaceHolder2_lblMeg").html("Data being processed, please wait...");
        } else {
            $("#ContentPlaceHolder2_lblMeg").html("You currently do not have permission to operate...");
        }
        //var t = setTimeout(timeOut, 7000);
    }
    function timeOut() {
        $("#ContentPlaceHolder2_lblMeg").html("");
    }
    function Quit() {
        $("#ContentPlaceHolder2_lblMeg").html("Cancel your operation...");
    }

    function GetChangeVal() {
        //ContentPlaceHolder2_ckbNatureList
        var addVal = "";
        var proVal = "";
        var delVal = "";
        var hiddenStr = $("#ContentPlaceHolder2_HiddenField_val").val();
        var hiddenVal = hiddenStr.substring(0, hiddenStr.length - 1).split(",");
        $("#ContentPlaceHolder2_ckbNatureList").find("input:checked").each(function (m, n) {
            var has = true;
            for (j = 0; j < hiddenVal.length; j++) {
                if (n.value == hiddenVal[j]) {
                    has = false;
                    break;
                }
            }
            if (has) {
                addVal += n.value + ",";
            } else {
                proVal += n.value + ",";
            }
        });
        proVal = proVal.substring(0, proVal.length - 1).split(",");
        for (i = 0; i < hiddenVal.length; i++) {
            var has = true;
            for (j = 0; j < proVal.length; j++) {
                if (hiddenVal[i] == proVal[j]) {
                    has = false;
                    break;
                }
            }
            if (has) {
                delVal += hiddenVal[i] + ",";
            }
        }

        $("#ContentPlaceHolder2_HiddenFiled_add").attr("value", addVal);
        $("#ContentPlaceHolder2_HiddenFiled_del").attr("value", delVal);
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<input type="hidden" value="t5" id="Hidden1" />
<div class="content-title">
    <input type="hidden" value="t5" id="pageName" />
        <h1>
            Membership Info</h1>
    </div>
    <div class="con-nav"><a href="#" class="btn"><span class="ui-icon ui-icon-newwin"></span>Add New Customer</a>
               </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
<uc1:usermeg ID="usermeg" runat="server" ></uc1:usermeg>  
<div class="partWrap">
<uc1:maintab ID="maintab"  runat="server"/>	
	<div class="clear20"></div>
<!-- CheckWrap end-->
<div class="CheckWrap">
    <asp:CheckBoxList ID="ckbNatureList" runat="server" RepeatDirection="Horizontal" Width="100%"  RepeatColumns="3"  CssClass="labelTb" CellPadding="0" CellSpacing="0">
    </asp:CheckBoxList>
</div>	
<asp:HiddenField runat="server" ID="HiddenField_val" />
<asp:HiddenField runat="server" ID="HiddenFiled_add" />
<asp:HiddenField runat="server" ID="HiddenFiled_del" />
<div class="clear20"></div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
  <ContentTemplate>
  	<table width="200" border="0" cellspacing="0" cellpadding="0">
		<tr>
		<td width="80">
			<ul class="uibtn">
    	    <li>
                    <span><asp:LinkButton ID="lkBtnSave"  runat="server" OnClientClick="return GetInfo()" onclick="btnSave_Click">Save</asp:LinkButton></span>
            </li>
	    </ul>
		</td>
		<td>
		<ul class="uibtn">
    	    <li onClick="javascript:ToggleDocument('wrapToggle')"><span><asp:LinkButton ID="LbtnQuit" runat="server" OnClick="LbtnQuit_Click" OnClientClick="return Quit()">Quit</asp:LinkButton></span></li>
	    </ul>
		</td>				
		</tr>
	</table>
     <p>
        <asp:Label ID="lblMeg" CssClass="clsWarningMeg" runat="server"></asp:Label>
      </p>
	</div><!-- partWrap end-->
   </ContentTemplate>
  </asp:UpdatePanel>  
</asp:Content>
